package com.ly.im.controller;

import com.ly.im.annotaion.LoginUser;
import com.ly.im.pojo.User;
import com.ly.im.service.UserService;
import com.ly.im.utils.ResponseUtils;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author LY
 * @create 2024/2/2 14:21
 * @Description 用户
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping
    public Object User(@LoginUser User user){
        return ResponseUtils.ok(user);
    }

    @GetMapping("/getUserByUserName")
    public Object getUserByUserName(String username){
        return ResponseUtils.ok(userService.getUserByUserName(username));
    }
}
